using System;
using System.Collections;
using System.Collections.Generic;
using Core.Utils;
using FT.Tweening;
using Game.Combat.Damage;
using UnityEngine;
using UnityEngine.UI;

public class TxtDamage : MonoBehaviour {
    private RectTransform mTransform;
    private Text mTxt;

    private void Awake() {
        mTransform = GetComponent<RectTransform>();
        mTxt = GetComponent<Text>();
    }

    public void Init(DamageParam param) {
        mTxt.text = param.Damage.ToString();
        trigger();
    }

    private void trigger() {
        mTransform.DOAnchorPosY(mTransform.anchoredPosition.y + 100.0f,50)
            .OnKill(() => {
                PoolMgr.Ins.Release(gameObject);    
            });
    }
}
